Passed
Push — master ( 923e12...5d294b )
by Jonathan
26:47
created

Autoloader   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
c 0
b 0
f 0
dl 0
loc 15
rs 10
wmc 3

2 Functions

Rating   Name   Duplication   Size   Complexity  
A lazyLoad 0 9 2
A constructor 0 3 1
1
import { UserAccount } from './user-account'
2
3
class Autoloader {
4
    constructor() {
5
        this.lazyLoad()
6
    }
7
8
    lazyLoad() {
9
        let page = $('meta[name="page"]').attr('content')
10
11
        switch (page) {
12
            case 'user-account':
13
                new UserAccount()
14
                break;
15
        }
16
    }
17
}
18
19
new Autoloader()
0 ignored issues
show
Unused Code Best Practice introduced by
The object created with new Autoloader() is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...